class CurrentThreadDemo
{
  public static void main(String args[])
  {
     thread t= thread.currentthread();  
     System.out.println("current thread: "+t);
     t.SetName("MY Thread");
     System.out.println("After name change: "+t);
     try
    {
      for(int n=5;n>0;n--)
      
        System.out.println(n);
        thread.sleep(1000);
      
   }
  catch (Interrupted Exception e)
   {
     System.out.println("Main thread interrupted");
   }
 }
}


